let vm = new Vue({
    el: '.page-content',
    data: {
        pageInfo: {},
        article: {},
        conditional: {
            title: ''
        }
    },
    methods: {
        selectPage: function (pageNum = 1, pageSize = 3) {

            axios({
                url: `mapper/article/selectPage/${pageNum}/${pageSize}`,
                params: this.conditional
            }).then(response => {
                this.pageInfo = response.data.obj;
            }).catch(error => {
                console.log(error.message)
            })
        },
        insert: function () {
            axios({
                url: "mapper/article/insert",
                method: "post",
                data: this.article
            }).then(response => {

                    if (response.data.success) {
                        //清空
                        this.article = {};

                        // //关闭窗口
                        // var index = parent.layer.getFrameIndex(window.name);
                        // parent.layer.close(index);
                    }
                    layer.msg("添加成功")
                    this.selectPage();
            }).catch(error => {
                layer.msg(error.message)
            })
        },

    },
    created: function () {
        this.article=parent.layer.obj;
        // this.selectPage();
    }

});